package com.chuangsi.project.admin.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 审批流程配置表
 * </p>
 *
 * @author
 * @since 2023-03-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "ApproveConfig对象", description = "审批流程配置表")
@TableName("t_approve_config")
public class ApproveConfig extends Model<ApproveConfig> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "审批流程配置id")
    @TableId(value = "approve_config_id", type = IdType.ASSIGN_UUID)
    @NotBlank(message = "审批流程配置id不能为空")
    @Size(max = 32, message = "审批流程配置id长度过长")
    private String approveConfigId;

    @ApiModelProperty(value = "审批类型（1.合同审批，2.订单审批，3.退保审批）")
    @NotEmpty(message = "审批类型（1.合同审批，2.订单审批，3.退保审批）不能为空")
    @Size(max = 1, message = "审批类型（1.合同审批，2.订单审批，3.退保审批）长度过长")
    private String type;

    @ApiModelProperty(value = "用户id")
    @NotNull(message = "用户id不能为空")
    private Long userId;


    @ApiModelProperty(value = "序号")
    private Integer sort;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "创建时间不能为空")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "修改时间不能为空")
    private LocalDateTime updateTime;


    @Override
    public Serializable pkVal() {
        return this.approveConfigId;
    }

}
